<?php
class lists extends connect { 
	function AddList($data) { 
		$query = "INSERT INTO `{$this->TableLists}` (`".implode('`, `', array_keys($data))."`) VALUES ('".implode("', '", $data)."')";
		$response = parent::$this->query($query);
		return $response;
	}
	function GetListByID($listID) {
		$query = "SELECT * FROM`{$this->TableLists}` WHERE listID = $listID";
		$response = $this->query($query);
		return $response;
	}
	function SetListByID($listID,$Field,$Data) {
		$query = "UPDATE `{$this->TableLists}` SET $Field='{$Data}' WHERE listID = '$listID'";
	}
	function DeleteListByID($listID) { 
		$query = "DELETE FROM `{$this->TableLists}` WHERE listID = `$listID`";
	}
	function GetListNameByID($listID) { 
		$query = "SELECT listName FROM`{$this->TableLists}` WHERE listID = $listID";
		$response = $this->query($query);
		while($data=mysql_fetch_array($response)) { 
			$listName=$data['listName'];
		}
		return $listName;
	}
	function ShowLists($max=50,$offset=0) { 
		$query = "SELECT * FROM`{$this->TableLists}` LIMIT $offset,$max";
		$response = $this->query($query);
		return $response;
	}
}
?>